#include"glad/glad.h"
#include"OpenGLContext.h"

#include"mgepch.h"


namespace myMiniEngine {
	OpenGLContext::OpenGLContext(GLFWwindow* _windowHandle): windowHandle(_windowHandle)
	{
		MGE_CORE_ASSERT(windowHandle, "Windowhandle is null!");
	}
	void OpenGLContext::Init()
	{
		glfwMakeContextCurrent(windowHandle);
		int status = gladLoadGLLoader((GLADloadproc)glfwGetProcAddress);
		MGE_CORE_ASSERT(status, "Glad init failed!");

		//MGE_CORE_INFO("OpenGL Renderer: {0}",glGetString(GL_VERSION));
	}
	void OpenGLContext::SwapBuffer()
	{
		glfwSwapBuffers(windowHandle);
	}
}


